#include "LogicalSequence.h"

LogicalSequence::LogicalSequence()
{
	//m_mapAnimationUnits = new map<string, AnimationUnit *>;
}

LogicalSequence::~LogicalSequence()
{
	//delete[] m_mapAnimationUnits;
}

string LogicalSequence::getName()
{
	return m_name;
}

void LogicalSequence::setName(const char* name)
{
	m_name = name;
}

string LogicalSequence::getStartName()
{
	return m_startName;
}

void LogicalSequence::setStartName(const char* startName)
{
	m_startName = startName;
}

bool LogicalSequence::addAnimationUnits(string name,AnimationUnit* pAnimationUnits)
{
	if (getAnimationUnits(name)==NULL)
	{
		m_mapAnimationUnits.insert(MapOfpAnimationUnit::value_type(name, pAnimationUnits));
		return true;
	}
	else
	{
		return false;
	}
}

AnimationUnit* LogicalSequence::getAnimationUnits(string name)
{
	MapOfpAnimationUnit::iterator it = m_mapAnimationUnits.find(name);
	if (it == m_mapAnimationUnits.end())
	{
		return it->second;
	}
	else
	{
		return NULL;
	}
}

AnimationUnit* LogicalSequence::getStartAnimationUnits()
{
	return getAnimationUnits(getStartName());
}